<template>
  <div>
    <p>Tab的count:{{ count }}</p>
    <p>{{ price }}</p>
    <ul>
      <li v-for="item in movieList" :key="item.id">{{ item.albumName }}</li>
    </ul>
    <p>长度大于4的电影</p>
    <ul>
      <li v-for="item in myMovieList" :key="item.id">{{ item.albumName }}</li>
    </ul>
    <p>长度是我传的</p>
    <ul>
      <li v-for="item in yourMovieList" :key="item.id">{{ item.albumName }}</li>
    </ul>
  </div>
</template>

<script>
import { mapGetters, mapState } from "vuex";
export default {
  name: "Tab",
  // 计算属性
  computed: {
    // 可以通过mapState的数组方式获取
    ...mapState(["count", "price", "movieList"]),
    ...mapGetters(["myMovieList"]),
    yourMovieList() {
      return this.$store.getters.yourMovieList({ star: 3 });
    },
  },
};
</script>
<style>
</style>